//
//  JoinQuizSelectView.m
//  WanCaiC8
//
//  Created by tangang on 2018/3/15.
//  Copyright © 2018年 tangang. All rights reserved.
//

#import "JoinQuizSelectView.h"
#import "LabCell.h"

#define itemSize   real_size(32)
#define itemInterval    real_size(5)

#define NumWidth real_size(300)
@interface JoinQuizSelectView()<UICollectionViewDelegate,UICollectionViewDataSource,UIGestureRecognizerDelegate>
///选号
@property (nonatomic ,strong) UICollectionView *numCollectionView;
///单双
@property (nonatomic ,strong) UICollectionView *singleCollectionView;
///大小
@property (nonatomic ,strong) UICollectionView *bigCollectionView;
///龙虎
@property (nonatomic ,strong) UICollectionView *tigerCollectionView;
///尾单双
@property (nonatomic ,strong) UICollectionView *tailCollectionView;
///合大小
@property (nonatomic ,strong) UICollectionView *sumCollectionView;
///东南西北
@property (nonatomic ,strong) UICollectionView *directionCollectionView;
///中发白
@property (nonatomic ,strong) UICollectionView *middleCollectionView;

@property (nonatomic ,strong) NSMutableArray   *selectArr;

@property (nonatomic ,strong) NSMutableArray *numArr;
@property (nonatomic ,strong) NSMutableArray *singleArr;
@property (nonatomic ,strong) NSMutableArray *bigArr;
@property (nonatomic ,strong) NSMutableArray *tigerArr;
///尾单双
@property (nonatomic ,strong) NSMutableArray *tailArr;
///合大小
@property (nonatomic ,strong) NSMutableArray *sumArr;
///东南西北
@property (nonatomic ,strong) NSMutableArray *directionArr;
///中发白
@property (nonatomic ,strong) NSMutableArray *middleArr;
@end

@implementation JoinQuizSelectView{
    LotteryNumType  lotteryType;
    JoinQuizSelectViewType selectViewType;
}

- (instancetype)initWithType:(LotteryNumType)type andViewType:(JoinQuizSelectViewType)viewType  andSelectArr:(NSMutableArray *)selectArr andSuccess:(void (^)(NSMutableArray *))success{
    if (self=[super init]) {
        self.sureBlock = success;
        self.selectArr=selectArr;
        lotteryType=type;
        selectViewType=viewType;
    }
    return self;
}

#pragma mark-- 单个
- (void)createSingleUI{
    UIView *numView=[[UIView alloc]init];
    numView.backgroundColor=[UIColor whiteColor];
    numView.layer.masksToBounds=YES;
    numView.layer.cornerRadius=5.0;
    [self addSubview:numView];
    if (lotteryType==LotteryNumTypeBrings) {
        if (selectViewType==JoinQuizSelectViewTypeNum) {
            numView.frame=CGRectMake(0, 0,NumWidth,real_size(90+(32+5)*7));
        }else{
            numView.frame=CGRectMake(0, 0, NumWidth, real_size(150));
        }
    }else if (lotteryType==LotteryNumType11Select5||lotteryType==LotteryNumTypeHappy12){
        numView.frame=CGRectMake(0, 0, NumWidth, real_size(150));
    }else if (lotteryType==LotteryNumTypeNearlyThree||lotteryType==LotteryNumTypeArrangement3||lotteryType==LotteryNumTypeSevenStars||lotteryType==LotteryNumTypeLottery3D){
        numView.frame=CGRectMake(0, 0, NumWidth, real_size(170));
    }else if (lotteryType==LotteryNumTypeLottery){
        if (selectViewType==JoinQuizSelectViewTypeColor||selectViewType==JoinQuizSelectViewTypeBig||selectViewType==JoinQuizSelectViewTypeSingle) {
            numView.frame=CGRectMake(0, 0, NumWidth, real_size(150));
        }else if (selectViewType==JoinQuizSelectViewTypeZodiac){
            numView.frame=CGRectMake(0, 0, NumWidth, real_size(200));
        }else{
            numView.frame=CGRectMake(0, 0, NumWidth, real_size(470));
        }
    }else if (lotteryType==LotteryNumTypeSevenLecai){
        numView.frame=CGRectMake(0, 0, NumWidth, real_size(310));
    }else if (lotteryType==LotteryNumTypeChromosphere){
        if (selectViewType==JoinQuizSelectViewTypeNum) {
            numView.frame=CGRectMake(0, 0, NumWidth, real_size(350));
        }else{
            numView.frame=CGRectMake(0, 0, NumWidth, real_size(150));
        }
    }
    numView.center=self.center;
    
    NSString *selectTitle=@"选号";
    QXLable *labTitle =[[QXLable alloc]initTitle];
    labTitle.textAlignment=NSTextAlignmentCenter;
    if (selectViewType==JoinQuizSelectViewTypeNum) {
        labTitle.text=@"请选择选号";
    }else{
        labTitle.text=@"请选择玩法";
        selectTitle=@"选择";
    }
    
    [numView addSubview:labTitle];
    [labTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(numView);
        make.top.equalTo(numView);
        make.size.mas_equalTo(CGSizeMake(real_size(150), real_size(32+5)));
    }];
    
    UIImageView *selectNumView=[self leftTitleViewWithTitle:selectTitle];
    [numView addSubview:selectNumView];
    [selectNumView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(numView).with.offset(real_size(5));
        make.top.equalTo(labTitle.mas_bottom).with.offset(real_size(5));
        make.size.mas_equalTo(selectNumView.image.size);
    }];
    
    [numView addSubview:self.numCollectionView];
    [self.numCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(selectNumView.mas_right).with.offset(real_size(5));
        make.top.equalTo(selectNumView);
        make.bottom.equalTo(numView).with.offset(-real_size(50));
        make.width.mas_equalTo(@(real_size((32+5)*5)));
    }];
    
    UIButton   *cancleBtn=[[UIButton alloc]init];
    cancleBtn.backgroundColor=DEFAULTTEXTGRAYCOLOR;
    [cancleBtn setTitle:@" 取消" forState:UIControlStateNormal];
    [cancleBtn setImage:[UIImage imageNamed:@"cancle"] forState:UIControlStateNormal];
    [cancleBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [cancleBtn addTarget:self action:@selector(removeSelf) forControlEvents:UIControlEventTouchUpInside];
    [numView addSubview:cancleBtn];
    [cancleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.equalTo(numView);
        make.width.equalTo(numView).with.multipliedBy(1/2.0);
        make.height.mas_equalTo(@(real_size(40)));
    }];
    
    UIButton   *sureBtn=[[UIButton alloc]init];
    sureBtn.backgroundColor=DEFAULTTEXTGRAYCOLOR;
    [sureBtn setTitle:@" 确定" forState:UIControlStateNormal];
    [sureBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [sureBtn addTarget:self action:@selector(onclickSure) forControlEvents:UIControlEventTouchUpInside];
    [sureBtn setImage:[UIImage imageNamed:@"sure"] forState:UIControlStateNormal];
    [numView addSubview:sureBtn];
    [sureBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.bottom.equalTo(numView);
        make.left.equalTo(cancleBtn.mas_right).with.offset(1);
        make.height.mas_equalTo(@(real_size(40)));
    }];
}


#pragma mark---混合
- (void)createHubridUI{
    WS(weakSelf);
    UIView *numView=[[UIView alloc]init];
    numView.backgroundColor=[UIColor whiteColor];
    numView.layer.masksToBounds=YES;
    numView.layer.cornerRadius=5.0;
    [self addSubview:numView];
    if (lotteryType==LotteryNumTypeCarPK10||lotteryType==LotteryNumTypeLuckyAirship) {
        numView.frame=CGRectMake(0, 0, NumWidth, real_size(250));
    }else if (lotteryType==LotteryNumType11Select5||lotteryType==LotteryNumTypeAllTime||lotteryType==LotteryNumTypeHappy12){
        if (selectViewType==JoinQuizSelectViewTypeSingle) {
            numView.frame=CGRectMake(0, 0, NumWidth, real_size(150));
        }else{
            numView.frame=CGRectMake(0, 0, NumWidth, real_size(250));
        }
    }else if (lotteryType==LotteryNumTypeNearlyThree){
        numView.frame=CGRectMake(0, 0, NumWidth, real_size(150));
    }else if (lotteryType==LotteryNumTypeArrangement3||lotteryType==LotteryNumTypeArrangement5||lotteryType==LotteryNumTypeSevenStars||lotteryType==LotteryNumTypeLottery3D){
        numView.frame=CGRectMake(0, 0, NumWidth, real_size(200));
    }else if (lotteryType==LotteryNumTypeSevenLecai){
        numView.frame=CGRectMake(0, 0, NumWidth, real_size(150));
    }
    numView.center=self.center;
    
    QXLable *labTitle =[[QXLable alloc]initTitle];
    labTitle.text=@"请选择玩法";
    labTitle.textAlignment=NSTextAlignmentCenter;
    [numView addSubview:labTitle];
    [labTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(numView);
        make.top.equalTo(numView);
        make.size.mas_equalTo(CGSizeMake(real_size(150), real_size(32+5)));
    }];
    
    UIImageView *selectNumView=[self leftTitleViewWithTitle:@"选号"];
    [numView addSubview:selectNumView];
    [selectNumView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(numView).with.offset(real_size(5));
        make.top.equalTo(labTitle.mas_bottom).with.offset(real_size(5));
        make.size.mas_equalTo(selectNumView.image.size);
    }];
    
    [numView addSubview:self.numCollectionView];
    [self.numCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(selectNumView.mas_right).with.offset(real_size(5));
        make.top.equalTo(selectNumView);
        make.width.mas_equalTo(@(real_size((32+5)*5)));
        make.height.mas_equalTo(@(real_size((32+5)*2)));
    }];
    
    UIImageView *singleView=[self leftTitleViewWithTitle:@"选择"];
    [numView addSubview:singleView];
    [singleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(numView).with.offset(real_size(5));
        make.top.equalTo(weakSelf.numCollectionView.mas_bottom).with.offset(real_size(5));
        make.size.mas_equalTo(selectNumView.image.size);
    }];
    [numView addSubview:self.singleCollectionView];
    [self.singleCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(selectNumView.mas_right).with.offset(real_size(5));
        make.top.equalTo(singleView);
        make.size.mas_equalTo(CGSizeMake(real_size((32+5)*2), real_size(32+5)));
    }];
    [numView addSubview:self.bigCollectionView];
    [self.bigCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.singleCollectionView.mas_right).with.offset(real_size(20));
        make.top.equalTo(singleView);
        make.size.mas_equalTo(CGSizeMake(real_size((32+5)*2), real_size(32+5)));
    }];
    
    UIImageView *tigerView=[self leftTitleViewWithTitle:@"选择"];
    [numView addSubview:tigerView];
    [tigerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(numView).with.offset(real_size(5));
        make.top.equalTo(weakSelf.bigCollectionView.mas_bottom).with.offset(real_size(5));
        make.size.mas_equalTo(selectNumView.image.size);
    }];
    [numView addSubview:self.tigerCollectionView];
    [self.tigerCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(selectNumView.mas_right).with.offset(real_size(5));
        make.top.equalTo(tigerView);
        make.size.mas_equalTo(CGSizeMake(real_size((32+5)*2), real_size(32+5)));
    }];
    
    if (lotteryType==LotteryNumType11Select5||lotteryType==LotteryNumTypeNearlyThree||lotteryType==LotteryNumTypeSevenLecai||lotteryType==LotteryNumTypeAllTime||lotteryType==LotteryNumTypeHappy12){
        tigerView.hidden=YES;
        self.tigerCollectionView.hidden=YES;
        if (selectViewType==JoinQuizSelectViewTypeSingle) {
            selectNumView.hidden=YES;
            [self.numCollectionView mas_updateConstraints:^(MASConstraintMaker *make) {
                make.height.mas_equalTo(@0);
            }];
        }else{
            [self.numCollectionView mas_updateConstraints:^(MASConstraintMaker *make) {
                make.height.mas_equalTo(@(real_size((32+5)*3)));
            }];
        }
    }
    
    if (lotteryType==LotteryNumTypeArrangement3||lotteryType==LotteryNumTypeArrangement5||lotteryType==LotteryNumTypeSevenStars||lotteryType==LotteryNumTypeLottery3D) {
        tigerView.hidden=YES;
        self.tigerCollectionView.hidden=YES;
        [self.numCollectionView mas_updateConstraints:^(MASConstraintMaker *make) {
            make.height.mas_equalTo(@(real_size((32+5)*2)));
        }];
    }
    
    
    UIButton   *cancleBtn=[[UIButton alloc]init];
    cancleBtn.backgroundColor=DEFAULTTEXTGRAYCOLOR;
    [cancleBtn setTitle:@" 取消" forState:UIControlStateNormal];
    [cancleBtn setImage:[UIImage imageNamed:@"cancle"] forState:UIControlStateNormal];
    [cancleBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [cancleBtn addTarget:self action:@selector(removeSelf) forControlEvents:UIControlEventTouchUpInside];
    [numView addSubview:cancleBtn];
    [cancleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.equalTo(numView);
        make.width.equalTo(numView).with.multipliedBy(1/2.0);
        make.height.mas_equalTo(@(real_size(40)));
    }];
    
    UIButton   *sureBtn=[[UIButton alloc]init];
    sureBtn.backgroundColor=DEFAULTTEXTGRAYCOLOR;
    [sureBtn setTitle:@" 确定" forState:UIControlStateNormal];
    [sureBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [sureBtn addTarget:self action:@selector(onclickSure) forControlEvents:UIControlEventTouchUpInside];
    [sureBtn setImage:[UIImage imageNamed:@"sure"] forState:UIControlStateNormal];
    [numView addSubview:sureBtn];
    [sureBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.bottom.equalTo(numView);
        make.left.equalTo(cancleBtn.mas_right).with.offset(1);
        make.height.mas_equalTo(@(real_size(40)));
    }];
}

- (UIImageView *)leftTitleViewWithTitle:(NSString *)title{
    UIImageView *titleView=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"rightArrowView"]];
    QXLable *lab=[[QXLable alloc]init];
    lab.text=title;
    lab.textAlignment=NSTextAlignmentCenter;
    [titleView addSubview:lab];
    [lab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(titleView).with.insets(UIEdgeInsetsMake(0, 0, 0, real_size(10)));
    }];
    return titleView;
}


#pragma mark -- 快乐十分
- (void)createHappyTenUI{
    WS(weakSelf);
    UIView *numView=[[UIView alloc]init];
    numView.backgroundColor=[UIColor whiteColor];
    numView.layer.masksToBounds=YES;
    numView.layer.cornerRadius=5.0;
    [self addSubview:numView];
    numView.frame=CGRectMake(0, 0, NumWidth, real_size(350));
    numView.center=self.center;
    
    QXLable *labTitle =[[QXLable alloc]initTitle];
    labTitle.text=@"请选择玩法";
    labTitle.textAlignment=NSTextAlignmentCenter;
    [numView addSubview:labTitle];
    [labTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(numView);
        make.top.equalTo(numView);
        make.size.mas_equalTo(CGSizeMake(real_size(150), real_size(32+5)));
    }];
    
    UIImageView *singleView=[self leftTitleViewWithTitle:@"选择"];
    [numView addSubview:singleView];
    [singleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(numView).with.offset(real_size(5));
        make.top.equalTo(labTitle.mas_bottom).with.offset(real_size(5));
        make.size.mas_equalTo(singleView.image.size);
    }];
    [numView addSubview:self.singleCollectionView];
    [self.singleCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(singleView.mas_right).with.offset(real_size(5));
        make.top.equalTo(singleView);
        make.size.mas_equalTo(CGSizeMake(real_size((32+5)*2), real_size(32+5)));
    }];
    [numView addSubview:self.bigCollectionView];
    [self.bigCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.singleCollectionView.mas_right).with.offset(real_size(20));
        make.top.equalTo(singleView);
        make.size.mas_equalTo(CGSizeMake(real_size((32+5)*2), real_size(32+5)));
    }];
    
    UIImageView *tailView=[self leftTitleViewWithTitle:@"合单双"];
    [numView addSubview:tailView];
    [tailView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(numView).with.offset(real_size(5));
        make.top.equalTo(weakSelf.bigCollectionView.mas_bottom).with.offset(real_size(5));
        make.size.mas_equalTo(tailView.image.size);
    }];
    [numView addSubview:self.tailCollectionView];
    [self.tailCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(tailView.mas_right).with.offset(real_size(5));
        make.top.equalTo(tailView);
        make.size.mas_equalTo(CGSizeMake(real_size((32+5)*2), real_size(32+5)));
    }];
    
    UIImageView *sumView=[self leftTitleViewWithTitle:@"尾大小"];
    [numView addSubview:sumView];
    [sumView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(numView).with.offset(real_size(5));
        make.top.equalTo(weakSelf.tailCollectionView.mas_bottom).with.offset(real_size(5));
        make.size.mas_equalTo(sumView.image.size);
    }];
    [numView addSubview:self.sumCollectionView];
    [self.sumCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(sumView.mas_right).with.offset(real_size(5));
        make.top.equalTo(sumView);
        make.size.mas_equalTo(CGSizeMake(real_size((32+5)*2), real_size(32+5)));
    }];
    if (self.selectArr.count==7) {
        UIImageView *tigerView=[self leftTitleViewWithTitle:@"选择"];
        [numView addSubview:tigerView];
        [tigerView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(numView).with.offset(real_size(5));
            make.top.equalTo(weakSelf.sumCollectionView.mas_bottom).with.offset(real_size(5));
            make.size.mas_equalTo(tigerView.image.size);
        }];
        [numView addSubview:self.tigerCollectionView];
        [self.tigerCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(tigerView.mas_right).with.offset(real_size(5));
            make.top.equalTo(tigerView);
            make.size.mas_equalTo(CGSizeMake(real_size((32+5)*2), real_size(32+5)));
        }];
    }else{
        [numView addSubview:self.tigerCollectionView];
        [self.tigerCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(numView);
            make.top.equalTo(weakSelf.sumCollectionView.mas_bottom);
            make.size.mas_equalTo(CGSizeMake(0, 0));
        }];
        numView.frame=CGRectMake(0, 0, NumWidth, real_size(313));
        numView.center=self.center;
    }
    
    UIImageView *directionView=[self leftTitleViewWithTitle:@"选择"];
    [numView addSubview:directionView];
    [directionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(numView).with.offset(real_size(5));
        make.top.equalTo(weakSelf.tigerCollectionView.mas_bottom).with.offset(real_size(5));
        make.size.mas_equalTo(directionView.image.size);
    }];
    [numView addSubview:self.directionCollectionView];
    [self.directionCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(directionView.mas_right).with.offset(real_size(5));
        make.top.equalTo(directionView);
        make.size.mas_equalTo(CGSizeMake(real_size((32+5)*4), real_size(32+5)));
    }];
    
    
    UIImageView *middleView=[self leftTitleViewWithTitle:@"选择"];
    [numView addSubview:middleView];
    [middleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(numView).with.offset(real_size(5));
        make.top.equalTo(weakSelf.directionCollectionView.mas_bottom).with.offset(real_size(5));
        make.size.mas_equalTo(middleView.image.size);
    }];
    [numView addSubview:self.middleCollectionView];
    [self.middleCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(middleView.mas_right).with.offset(real_size(5));
        make.top.equalTo(middleView);
        make.size.mas_equalTo(CGSizeMake(real_size(120), real_size(32+5)));
    }];
    
    UIButton   *cancleBtn=[[UIButton alloc]init];
    cancleBtn.backgroundColor=DEFAULTTEXTGRAYCOLOR;
    [cancleBtn setTitle:@" 取消" forState:UIControlStateNormal];
    [cancleBtn setImage:[UIImage imageNamed:@"cancle"] forState:UIControlStateNormal];
    [cancleBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [cancleBtn addTarget:self action:@selector(removeSelf) forControlEvents:UIControlEventTouchUpInside];
    [numView addSubview:cancleBtn];
    [cancleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.equalTo(numView);
        make.width.equalTo(numView).with.multipliedBy(1/2.0);
        make.height.mas_equalTo(@(real_size(40)));
    }];
    
    UIButton   *sureBtn=[[UIButton alloc]init];
    sureBtn.backgroundColor=DEFAULTTEXTGRAYCOLOR;
    [sureBtn setTitle:@" 确定" forState:UIControlStateNormal];
    [sureBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [sureBtn addTarget:self action:@selector(onclickSure) forControlEvents:UIControlEventTouchUpInside];
    [sureBtn setImage:[UIImage imageNamed:@"sure"] forState:UIControlStateNormal];
    [numView addSubview:sureBtn];
    [sureBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.bottom.equalTo(numView);
        make.left.equalTo(cancleBtn.mas_right).with.offset(1);
        make.height.mas_equalTo(@(real_size(40)));
    }];
}

- (void)show{
    self.backgroundColor=[UIColor colorWithWhite:0 alpha:.1];
    [self setFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    UITapGestureRecognizer *tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(removeSelf)];
    tap.delegate=self;
    [self addGestureRecognizer:tap];
    UIWindow *window=[UIApplication sharedApplication].keyWindow;
    [window addSubview:self];
    if (lotteryType==LotteryNumTypeCarPK10||lotteryType==LotteryNumTypeLuckyAirship||lotteryType==LotteryNumTypeArrangement5||lotteryType==LotteryNumTypeSevenStars||lotteryType==LotteryNumTypeAllTime) {
        [self createHubridUI];
    }else if (lotteryType==LotteryNumTypeBrings){
        [self createSingleUI];
    }else if (lotteryType==LotteryNumType11Select5||lotteryType==LotteryNumTypeHappy12){
        if (selectViewType==JoinQuizSelectViewTypeTiger) {
            [self createSingleUI];
        }else{
            [self createHubridUI];
        }
    }else if (lotteryType==LotteryNumTypeHappy10){
        [self createHappyTenUI];
    }else if (lotteryType==LotteryNumTypeNearlyThree){
        if (selectViewType==JoinQuizSelectViewTypeNum) {
            [self createSingleUI];
        }else{
            [self createHubridUI];
        }
    }else if ((lotteryType==LotteryNumTypeLottery)||lotteryType==LotteryNumTypeChromosphere){
        [self createSingleUI];
    }else if (lotteryType==LotteryNumTypeArrangement3||lotteryType==LotteryNumTypeSevenLecai||lotteryType==LotteryNumTypeLottery3D){
        if (selectViewType==JoinQuizSelectViewTypeNum) {
            [self createSingleUI];
        }else{
            [self createHubridUI];
        }
    }
}

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
    
    if ([touch.view isDescendantOfView:self]) {
        return NO;
    }
    
    return NO;
    
}

- (void)onclickSure{
    if (lotteryType==LotteryNumTypeCarPK10||lotteryType==LotteryNumTypeLuckyAirship||(lotteryType==LotteryNumType11Select5&&selectViewType==JoinQuizSelectViewTypeHybrid)||(lotteryType==LotteryNumTypeBrings&&selectViewType==JoinQuizSelectViewTypeNum)||(lotteryType==LotteryNumTypeLottery&&selectViewType==JoinQuizSelectViewTypeNum)||(lotteryType==LotteryNumTypeLottery&&selectViewType==JoinQuizSelectViewTypeZodiac)||lotteryType==LotteryNumTypeArrangement3||lotteryType==LotteryNumTypeLottery3D||lotteryType==LotteryNumTypeArrangement5||lotteryType==LotteryNumTypeSevenStars||(lotteryType==LotteryNumTypeSevenLecai&&selectViewType==JoinQuizSelectViewTypeNum)||(lotteryType==LotteryNumTypeChromosphere&&selectViewType==JoinQuizSelectViewTypeNum)||(lotteryType==LotteryNumTypeAllTime&&selectViewType==JoinQuizSelectViewTypeNum)||(lotteryType==LotteryNumTypeHappy12&&selectViewType==JoinQuizSelectViewTypeHybrid)) {
        NSString *strNum=self.selectArr[0];
        if (strNum.length>0) {
            NSArray *arr=[strNum componentsSeparatedByString:@","];
            if (arr.count!=self.numCount) {
                [SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"选号至少选%ld个",(long)self.numCount]];
                return;
            }
        }
    }
    if (self.sureBlock) {
        self.sureBlock(self.selectArr);
    }
    [self removeSelf];
}

- (void)removeSelf{
    [self removeFromSuperview];
}


#pragma mark - collectionView代理函数
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    if (collectionView==self.numCollectionView) {
        return self.numArr.count;
    }else if (collectionView==self.singleCollectionView){
        return self.singleArr.count;
    }else if (collectionView==self.bigCollectionView){
        return self.bigArr.count;
    }else if (collectionView==self.tigerCollectionView){
        return self.tigerArr.count;
    }else if (collectionView==self.tailCollectionView){
        return self.tailArr.count;
    }else if (collectionView==self.sumCollectionView){
        return self.sumArr.count;
    }else if (collectionView==self.directionCollectionView){
        return self.directionArr.count;
    }else if (collectionView==self.middleCollectionView){
        return self.middleArr.count;
    }
    return 0;
}

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    LabCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"LabCell" forIndexPath:indexPath];
    if (collectionView==self.numCollectionView) {
        NSString *str=self.selectArr[0];
        str=[str stringByReplacingOccurrencesOfString:@"波" withString:@""];
        NSArray *numArr=[str componentsSeparatedByString:@","];
        [cell setBGColorWithTitle:self.numArr[indexPath.row] andCornerRadius:real_size(16) andIsSelect:[numArr containsObject:self.numArr[indexPath.row]]];
        NSLog(@"%@",str);
        NSLog(@"%@",self.numArr[indexPath.row]);
    }else if (collectionView==self.singleCollectionView){
        NSString *str;
        if (lotteryType==LotteryNumTypeHappy10||(lotteryType==LotteryNumType11Select5&&selectViewType==JoinQuizSelectViewTypeSingle)||lotteryType==LotteryNumTypeSevenLecai||(lotteryType==LotteryNumTypeAllTime&&selectViewType==JoinQuizSelectViewTypeSingle)||lotteryType==LotteryNumTypeNearlyThree||(lotteryType==LotteryNumTypeHappy12&&selectViewType==JoinQuizSelectViewTypeSingle)) {
            str=self.selectArr[0];
        }else{
            str=self.selectArr[1];
        }
        
        [cell setBGColorWithTitle:self.singleArr[indexPath.row] andCornerRadius:real_size(16) andIsSelect:[str containsString:self.singleArr[indexPath.row]]];
    }else if (collectionView==self.bigCollectionView){
        NSString *str;
        if (lotteryType==LotteryNumTypeHappy10||(lotteryType==LotteryNumType11Select5&&selectViewType==JoinQuizSelectViewTypeSingle)||lotteryType==LotteryNumTypeSevenLecai||(lotteryType==LotteryNumTypeAllTime&&selectViewType==JoinQuizSelectViewTypeSingle)||lotteryType==LotteryNumTypeNearlyThree||(lotteryType==LotteryNumTypeHappy12&&selectViewType==JoinQuizSelectViewTypeSingle)) {
            str=self.selectArr[1];
        }else{
            str=self.selectArr[2];
        }
        [cell setBGColorWithTitle:self.bigArr[indexPath.row] andCornerRadius:real_size(16) andIsSelect:[str containsString:self.bigArr[indexPath.row]]];
    }else if (collectionView==self.tigerCollectionView){
        NSString *str;
        if (lotteryType==LotteryNumTypeCarPK10||lotteryType==LotteryNumTypeLuckyAirship) {
            str=[self.selectArr objectAtIndex:3];
        }else if (lotteryType==LotteryNumTypeHappy10){
            str=[self.selectArr objectAtIndex:4];
        }
        [cell setBGColorWithTitle:self.tigerArr[indexPath.row] andCornerRadius:real_size(16) andIsSelect:[str containsString:self.tigerArr[indexPath.row]]];
    }else if (collectionView==self.tailCollectionView){
        NSString *str=self.selectArr[2];
        [cell setBGColorWithTitle:self.tailArr[indexPath.row] andCornerRadius:real_size(16) andIsSelect:[str containsString:self.tailArr[indexPath.row]]];
    }else if (collectionView==self.sumCollectionView){
        NSString *str=self.selectArr[3];
        [cell setBGColorWithTitle:self.sumArr[indexPath.row] andCornerRadius:real_size(16) andIsSelect:[str containsString:self.sumArr[indexPath.row]]];
    }else if (collectionView==self.directionCollectionView){
        NSString *str=self.selectArr[self.selectArr.count-2];
        [cell setBGColorWithTitle:self.directionArr[indexPath.row] andCornerRadius:real_size(16) andIsSelect:[str containsString:self.directionArr[indexPath.row]]];
    }else if (collectionView==self.middleCollectionView){
        NSString *str=self.selectArr.lastObject;
        [cell setBGColorWithTitle:self.middleArr[indexPath.row] andCornerRadius:real_size(16) andIsSelect:[str containsString:self.middleArr[indexPath.row]]];
    }
    
    return cell;
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
    
    if (collectionView==self.numCollectionView) {
        NSString *str=self.selectArr[0];
        NSString *selectStr=self.numArr[indexPath.row];
        if (lotteryType==LotteryNumTypeCarPK10||lotteryType==LotteryNumTypeLuckyAirship||(lotteryType==LotteryNumType11Select5&&selectViewType==JoinQuizSelectViewTypeHybrid)||(lotteryType==LotteryNumTypeBrings&&selectViewType==JoinQuizSelectViewTypeNum)||lotteryType==LotteryNumTypeNearlyThree||(lotteryType==LotteryNumTypeLottery&&selectViewType==JoinQuizSelectViewTypeNum)||(lotteryType==LotteryNumTypeLottery&&selectViewType==JoinQuizSelectViewTypeZodiac)||lotteryType==LotteryNumTypeLottery3D||lotteryType==LotteryNumTypeArrangement3||lotteryType==LotteryNumTypeArrangement5||lotteryType==LotteryNumTypeSevenStars||(lotteryType==LotteryNumTypeChromosphere&&selectViewType==JoinQuizSelectViewTypeNum)||lotteryType==LotteryNumTypeAllTime||(lotteryType==LotteryNumTypeHappy12&&selectViewType==JoinQuizSelectViewTypeHybrid)||lotteryType==LotteryNumTypeSevenLecai) {
            NSMutableArray *arr=[[str componentsSeparatedByString:@","] mutableCopy];
            [arr removeObject:@""];
            if ([arr containsObject:selectStr]) {
                [arr removeObject:selectStr];
            }else{
                if (arr.count<self.numCount) {
                    [arr addObject:selectStr];
                }
            }
            NSString *newStr=[arr componentsJoinedByString:@","];
            [self.selectArr replaceObjectAtIndex:0 withObject:newStr];
        }else if (lotteryType==LotteryNumTypeBrings||lotteryType==LotteryNumType11Select5||lotteryType==LotteryNumTypeLottery||lotteryType==LotteryNumTypeChromosphere||lotteryType==LotteryNumTypeHappy12){
            if ([selectStr isEqualToString:@"红"]||[selectStr isEqualToString:@"绿"]||[selectStr isEqualToString:@"蓝"]) {
                selectStr=[NSString stringWithFormat:@"%@波",selectStr];
            }
            
            if ([str isEqualToString:selectStr]) {
                [self.selectArr replaceObjectAtIndex:0 withObject:@""];
            }else{
                [self.selectArr replaceObjectAtIndex:0 withObject:selectStr];
            }
        }
    }else if (collectionView==self.singleCollectionView){
        NSInteger row=1;
        if (lotteryType==LotteryNumTypeHappy10||(lotteryType==LotteryNumType11Select5&&selectViewType==JoinQuizSelectViewTypeSingle)||lotteryType==LotteryNumTypeSevenLecai||(lotteryType==LotteryNumTypeAllTime&&selectViewType==JoinQuizSelectViewTypeSingle)||lotteryType==LotteryNumTypeNearlyThree||(lotteryType==LotteryNumTypeHappy12&&selectViewType==JoinQuizSelectViewTypeSingle)) {
            row=0;
        }
        
        NSString *str=self.selectArr[row];
        NSString *selectStr=self.singleArr[indexPath.row];
        if ([str isEqualToString:selectStr]) {
            [self.selectArr replaceObjectAtIndex:row withObject:@""];
        }else{
            [self.selectArr replaceObjectAtIndex:row withObject:selectStr];
        }
    }else if (collectionView==self.bigCollectionView){
        NSInteger row=2;
        if (lotteryType==LotteryNumTypeHappy10||(lotteryType==LotteryNumType11Select5&&selectViewType==JoinQuizSelectViewTypeSingle)||lotteryType==LotteryNumTypeSevenLecai||(lotteryType==LotteryNumTypeAllTime&&selectViewType==JoinQuizSelectViewTypeSingle)||lotteryType==LotteryNumTypeNearlyThree||(lotteryType==LotteryNumTypeHappy12&&selectViewType==JoinQuizSelectViewTypeSingle)) {
            row=1;
        }
        NSString *str=self.selectArr[row];
        NSString *selectStr=self.bigArr[indexPath.row];
        if ([str isEqualToString:selectStr]) {
            [self.selectArr replaceObjectAtIndex:row withObject:@""];
        }else{
            [self.selectArr replaceObjectAtIndex:row withObject:selectStr];
        }
    }else if (collectionView==self.tigerCollectionView){
        NSInteger row=3;
        if (lotteryType==LotteryNumTypeHappy10) {
            row=4;
        }
        NSString *str=self.selectArr[row];
        NSString *selectStr=self.tigerArr[indexPath.row];
        if ([str isEqualToString:selectStr]) {
            [self.selectArr replaceObjectAtIndex:row withObject:@""];
        }else{
            [self.selectArr replaceObjectAtIndex:row withObject:selectStr];
        }
    }else if (collectionView==self.tailCollectionView){
        NSString *str=self.selectArr[2];
        NSString *selectStr=self.tailArr[indexPath.row];
        if ([str isEqualToString:selectStr]) {
            [self.selectArr replaceObjectAtIndex:2 withObject:@""];
        }else{
            [self.selectArr replaceObjectAtIndex:2 withObject:selectStr];
        }
    }else if (collectionView==self.sumCollectionView){
        NSString *str=self.selectArr[3];
        NSString *selectStr=self.sumArr[indexPath.row];
        if ([str isEqualToString:selectStr]) {
            [self.selectArr replaceObjectAtIndex:3 withObject:@""];
        }else{
            [self.selectArr replaceObjectAtIndex:3 withObject:selectStr];
        }
    }else if (collectionView==self.directionCollectionView){
        NSString *str=self.selectArr[self.selectArr.count-2];
        NSString *selectStr=self.directionArr[indexPath.row];
        if ([str isEqualToString:selectStr]) {
            [self.selectArr replaceObjectAtIndex:self.selectArr.count-2 withObject:@""];
        }else{
            [self.selectArr replaceObjectAtIndex:self.selectArr.count-2 withObject:selectStr];
        }
    }else if (collectionView==self.middleCollectionView){
        NSString *str=self.selectArr.lastObject;
        NSString *selectStr=self.middleArr[indexPath.row];
        if ([str isEqualToString:selectStr]) {
            [self.selectArr replaceObjectAtIndex:self.selectArr.count-1 withObject:@""];
        }else{
            [self.selectArr replaceObjectAtIndex:self.selectArr.count-1 withObject:selectStr];
        }
    }
    
    [collectionView reloadData];
}

#pragma mark -- 懒加载
- (UICollectionView *)numCollectionView{
    if (!_numCollectionView) {
        UICollectionViewFlowLayout *flowLayout =
        [[UICollectionViewFlowLayout alloc] init];
        [flowLayout setItemSize:CGSizeMake(itemSize, itemSize)];
        flowLayout.minimumLineSpacing=itemInterval;
        flowLayout.minimumInteritemSpacing=itemInterval;
        [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
        _numCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
                                             collectionViewLayout:flowLayout];
        [_numCollectionView registerClass:[LabCell class] forCellWithReuseIdentifier:@"LabCell"];
        _numCollectionView.delegate = self;
        _numCollectionView.dataSource = self;
        _numCollectionView.backgroundColor = [UIColor whiteColor];
    }
    return _numCollectionView;
}

- (UICollectionView *)singleCollectionView{
    if (!_singleCollectionView) {
        UICollectionViewFlowLayout *flowLayout =
        [[UICollectionViewFlowLayout alloc] init];
        [flowLayout setItemSize:CGSizeMake(itemSize, itemSize)];
        flowLayout.minimumLineSpacing=itemInterval;
        flowLayout.minimumInteritemSpacing=itemInterval;
        [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
        _singleCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
                                                collectionViewLayout:flowLayout];
        [_singleCollectionView registerClass:[LabCell class] forCellWithReuseIdentifier:@"LabCell"];
        _singleCollectionView.delegate = self;
        _singleCollectionView.dataSource = self;
        _singleCollectionView.backgroundColor = [UIColor whiteColor];
    }
    return _singleCollectionView;
}

- (UICollectionView *)bigCollectionView{
    if (!_bigCollectionView) {
        UICollectionViewFlowLayout *flowLayout =
        [[UICollectionViewFlowLayout alloc] init];
        [flowLayout setItemSize:CGSizeMake(itemSize, itemSize)];
        flowLayout.minimumLineSpacing=itemInterval;
        flowLayout.minimumInteritemSpacing=itemInterval;
        [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
        _bigCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
                                                   collectionViewLayout:flowLayout];
        [_bigCollectionView registerClass:[LabCell class] forCellWithReuseIdentifier:@"LabCell"];
        _bigCollectionView.delegate = self;
        _bigCollectionView.dataSource = self;
        _bigCollectionView.backgroundColor = [UIColor whiteColor];
    }
    return _bigCollectionView;
}

- (UICollectionView *)tigerCollectionView{
    if (!_tigerCollectionView) {
        UICollectionViewFlowLayout *flowLayout =
        [[UICollectionViewFlowLayout alloc] init];
        [flowLayout setItemSize:CGSizeMake(itemSize, itemSize)];
        flowLayout.minimumLineSpacing=itemInterval;
        flowLayout.minimumInteritemSpacing=itemInterval;
        [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
        _tigerCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
                                                collectionViewLayout:flowLayout];
        [_tigerCollectionView registerClass:[LabCell class] forCellWithReuseIdentifier:@"LabCell"];
        _tigerCollectionView.delegate = self;
        _tigerCollectionView.dataSource = self;
        _tigerCollectionView.backgroundColor = [UIColor whiteColor];
    }
    return _tigerCollectionView;
}

- (UICollectionView *)tailCollectionView{
    if (!_tailCollectionView) {
        UICollectionViewFlowLayout *flowLayout =
        [[UICollectionViewFlowLayout alloc] init];
        [flowLayout setItemSize:CGSizeMake(itemSize, itemSize)];
        flowLayout.minimumLineSpacing=itemInterval;
        flowLayout.minimumInteritemSpacing=itemInterval;
        [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
        _tailCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
                                                  collectionViewLayout:flowLayout];
        [_tailCollectionView registerClass:[LabCell class] forCellWithReuseIdentifier:@"LabCell"];
        _tailCollectionView.delegate = self;
        _tailCollectionView.dataSource = self;
        _tailCollectionView.backgroundColor = [UIColor whiteColor];
    }
    return _tailCollectionView;
}

- (UICollectionView *)sumCollectionView{
    if (!_sumCollectionView) {
        UICollectionViewFlowLayout *flowLayout =
        [[UICollectionViewFlowLayout alloc] init];
        [flowLayout setItemSize:CGSizeMake(itemSize, itemSize)];
        flowLayout.minimumLineSpacing=itemInterval;
        flowLayout.minimumInteritemSpacing=itemInterval;
        [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
        _sumCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
                                                 collectionViewLayout:flowLayout];
        [_sumCollectionView registerClass:[LabCell class] forCellWithReuseIdentifier:@"LabCell"];
        _sumCollectionView.delegate = self;
        _sumCollectionView.dataSource = self;
        _sumCollectionView.backgroundColor = [UIColor whiteColor];
    }
    return _sumCollectionView;
}

- (UICollectionView *)directionCollectionView{
    if (!_directionCollectionView) {
        UICollectionViewFlowLayout *flowLayout =
        [[UICollectionViewFlowLayout alloc] init];
        [flowLayout setItemSize:CGSizeMake(itemSize, itemSize)];
        flowLayout.minimumLineSpacing=itemInterval;
        flowLayout.minimumInteritemSpacing=itemInterval;
        [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
        _directionCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
                                                collectionViewLayout:flowLayout];
        [_directionCollectionView registerClass:[LabCell class] forCellWithReuseIdentifier:@"LabCell"];
        _directionCollectionView.delegate = self;
        _directionCollectionView.dataSource = self;
        _directionCollectionView.backgroundColor = [UIColor whiteColor];
    }
    return _directionCollectionView;
}

- (UICollectionView *)middleCollectionView{
    if (!_middleCollectionView) {
        UICollectionViewFlowLayout *flowLayout =
        [[UICollectionViewFlowLayout alloc] init];
        [flowLayout setItemSize:CGSizeMake(itemSize,itemSize)];
        flowLayout.minimumLineSpacing=itemInterval;
        flowLayout.minimumInteritemSpacing=itemInterval;
        [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
        _middleCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
                                                      collectionViewLayout:flowLayout];
        [_middleCollectionView registerClass:[LabCell class] forCellWithReuseIdentifier:@"LabCell"];
        _middleCollectionView.delegate = self;
        _middleCollectionView.dataSource = self;
        _middleCollectionView.backgroundColor = [UIColor whiteColor];
    }
    return _middleCollectionView;
}

- (NSMutableArray *)numArr{
    if (!_numArr) {
        if (lotteryType==LotteryNumTypeCarPK10||lotteryType==LotteryNumTypeLuckyAirship) {
            _numArr=[[NSMutableArray alloc]initWithObjects:@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10", nil];
        }else if (lotteryType==LotteryNumTypeBrings){
            if (selectViewType==JoinQuizSelectViewTypeNum) {
                _numArr=[[NSMutableArray alloc]initWithObjects:@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30",@"31",@"32",@"33",@"34",@"35", nil];
            }else if (selectViewType==JoinQuizSelectViewTypeSingle){
                _numArr=self.singleArr;
            }else if (selectViewType==JoinQuizSelectViewTypeBig){
                _numArr=self.bigArr;
            }else if (selectViewType==JoinQuizSelectViewTypeTiger){
                _numArr=self.tigerArr;
            }
        }else if (lotteryType==LotteryNumType11Select5){
            if (selectViewType==JoinQuizSelectViewTypeTiger) {
                _numArr=self.tigerArr;
            }else{
                _numArr=[[NSMutableArray alloc]initWithObjects:@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"10",@"11", nil];
            }
        }else if (lotteryType==LotteryNumTypeHappy12){
            if (selectViewType==JoinQuizSelectViewTypeTiger) {
                _numArr=self.tigerArr;
            }else{
                _numArr=[[NSMutableArray alloc]initWithObjects:@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"10",@"11",@"12", nil];
            }
        }
        else if (lotteryType==LotteryNumTypeAllTime){
            _numArr=[[NSMutableArray alloc]initWithObjects:@"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9", nil];
        }else if (lotteryType==LotteryNumTypeSevenLecai){
            _numArr=[[NSMutableArray alloc]initWithObjects:@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30", nil];
        }else if (lotteryType==LotteryNumTypeNearlyThree){
            _numArr=[[NSMutableArray alloc]initWithObjects:@"1",@"2",@"3",@"4",@"5",@"6", nil];
        }else if (lotteryType==LotteryNumTypeLottery){
            if (selectViewType==JoinQuizSelectViewTypeNum) {
                _numArr=[[NSMutableArray alloc]initWithObjects:@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30",@"31",@"32",@"33",@"34",@"35",@"36",@"37",@"38",@"39",@"40",@"41",@"42",@"43",@"44",@"45",@"46",@"47",@"48",@"49", nil];
            }else if (selectViewType==JoinQuizSelectViewTypeSingle){
                _numArr=self.singleArr;
            }else if (selectViewType==JoinQuizSelectViewTypeBig){
                _numArr=self.bigArr;
            }else if (selectViewType==JoinQuizSelectViewTypeZodiac){
                _numArr=[[NSMutableArray alloc]initWithObjects:@"鼠",@"牛",@"虎",@"兔",@"龙",@"蛇",@"马",@"羊",@"猴",@"鸡",@"狗",@"猪", nil];
            }else if (selectViewType==JoinQuizSelectViewTypeColor){
                _numArr=[[NSMutableArray alloc]initWithObjects:@"红",@"绿",@"蓝", nil];
            }
        }else if (lotteryType==LotteryNumTypeLottery3D||lotteryType==LotteryNumTypeSevenStars||lotteryType==LotteryNumTypeArrangement3||lotteryType==LotteryNumTypeArrangement5){
            _numArr=[[NSMutableArray alloc]initWithObjects:@"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9", nil];
        }else if (lotteryType==LotteryNumTypeChromosphere){
            if (selectViewType==JoinQuizSelectViewTypeNum) {
                _numArr=[[NSMutableArray alloc]initWithObjects:@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30",@"31",@"32",@"33", nil];
            }else if (selectViewType==JoinQuizSelectViewTypeSingle){
                _numArr=self.singleArr;
            }else if (selectViewType==JoinQuizSelectViewTypeBig){
                _numArr=self.bigArr;
            }
        }
    }
    return _numArr;
}

- (NSMutableArray *)singleArr{
    if (!_singleArr) {
        _singleArr=[[NSMutableArray alloc]initWithObjects:@"单",@"双", nil];
    }
    return _singleArr;
}

- (NSMutableArray *)bigArr{
    if (!_bigArr) {
        _bigArr=[[NSMutableArray alloc]initWithObjects:@"大",@"小", nil];
    }
    return _bigArr;
}

- (NSMutableArray *)tigerArr{
    if (!_tigerArr) {
        _tigerArr=[[NSMutableArray alloc]initWithObjects:@"龙",@"虎", nil];
    }
    return _tigerArr;
}

- (NSMutableArray *)tailArr{
    if (!_tailArr) {
        _tailArr=[[NSMutableArray alloc]initWithObjects:@"单",@"双", nil];
    }
    return _tailArr;
}

- (NSMutableArray *)sumArr{
    if (!_sumArr) {
        _sumArr=[[NSMutableArray alloc]initWithObjects:@"大",@"小", nil];
    }
    return _sumArr;
}

- (NSMutableArray *)directionArr{
    if (!_directionArr) {
        _directionArr=[[NSMutableArray alloc]initWithObjects:@"东",@"南",@"西",@"北", nil];
    }
    return _directionArr;
}

- (NSMutableArray *)middleArr{
    if (!_middleArr) {
        _middleArr=[[NSMutableArray alloc]initWithObjects:@"中",@"发",@"白", nil];
    }
    return _middleArr;
}

@end
